# Maintainer: Antoni Aloy <aaloytorrens@gmail.com>
pkgname=hypnotix
pkgver=2.0
pkgrel=0
pkgdesc="IPTV streaming application"
url="https://github.com/linuxmint/hypnotix"
arch="noarch"
license="GPL-3.0-or-later"
depends="
	dconf python3 py3-cairo xapp py3-requests
	py3-setproctitle py3-imdbpy mpv mpv-libs
	"
makedepends="gettext-tiny"
subpackages="$pkgname-lang"
options="!check" # No testsuite
source="$pkgname-$pkgver.tar.gz::https://github.com/linuxmint/hypnotix/archive/$pkgver.tar.gz
	0001-fix-locale-has-no-attribute-bindtextdomain.patch
	"

prepare() {
	default_prepare
	sed -i "s/__DEB_VERSION__/$pkgver/g" "$builddir"/usr/lib/hypnotix/hypnotix.py
}

build() {
	make
}

package() {
	install -D     -t "$pkgdir"/usr/bin usr/bin/hypnotix
	install -D     -t "$pkgdir"/usr/lib/hypnotix usr/lib/hypnotix/hypnotix.py
	install -D     -t "$pkgdir"/usr/lib/hypnotix usr/lib/hypnotix/common.py
	install -Dm644 -t "$pkgdir"/usr/lib/hypnotix usr/lib/hypnotix/mpv.py
	install -Dm644 -t "$pkgdir"/usr/share/applications usr/share/applications/hypnotix.desktop
	install -Dm644 -t "$pkgdir"/usr/share/glib-2.0/schemas usr/share/glib-2.0/schemas/org.x.hypnotix.gschema.xml
	install -Dm644 -t "$pkgdir"/usr/share/hypnotix usr/share/hypnotix/*.css
	install -Dm644 -t "$pkgdir"/usr/share/hypnotix usr/share/hypnotix/*.ui
	install -Dm644 -t "$pkgdir"/usr/share/hypnotix usr/share/hypnotix/*.png
	install -Dm644 -t "$pkgdir"/usr/share/hypnotix/pictures usr/share/hypnotix/pictures/*.svg
	install -Dm644 -t "$pkgdir"/usr/share/hypnotix/pictures/badges usr/share/hypnotix/pictures/badges/*
	install -Dm644 -t "$pkgdir"/usr/share/icons/hicolor/scalable/apps usr/share/icons/hicolor/scalable/apps/hypnotix.svg

	# locales
	cp -a usr/share/locale "$pkgdir"/usr/share/locale
}

sha512sums="
a230cabc35e1a958c5fb146c6541980153d60b48130b828c5460a3f82116f279ee9e86e124e8fa6663dcc831715c22f79a96f10b574b6ff91f9e5ff74a157ce5  hypnotix-2.0.tar.gz
b54f92f043b5d3bcba31266e21a263a0ef3428c3b3afbb4f9fcca11df1230a1e547abaf3bc047e4c975f8941d5a31c46c1ac1dbb9c3281dcb48553f941968478  0001-fix-locale-has-no-attribute-bindtextdomain.patch
"
